package com.gisocn.onemap.ui.activity;

import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.gisocn.onemap.base.BaseActivity;
import com.gisocn.onemap.base.BasePresenter;
import com.gisocn.onemap.sgzx.R;
import com.gisocn.onemap.utils.L;

/* loaded from: classes2.dex */
public class WebActivity extends BaseActivity {
    private String actionUrl;
    WebView webView;

    private void test_() {
    }

    @Override // com.gisocn.onemap.base.BaseActivity
    protected BasePresenter createPresenter() {
        return null;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // com.gisocn.onemap.base.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_test_web);
        this.webView = (WebView) findViewById(R.id.web);
        this.actionUrl = "http://192.168.0.31:6080/geoscene/rest/services/ZQ/XZQH_WMTS/MapServer";
        initWebView();
    }

    private void initWebView() {
        WebSettings settings = this.webView.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setDatabaseEnabled(true);
        settings.setAppCacheEnabled(true);
        settings.setCacheMode(2);
        settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        settings.setDomStorageEnabled(true);
        this.webView.isOpaque();
        this.webView.setLayerType(2, null);
        this.webView.setScrollBarStyle(0);
        this.webView.setWebChromeClient(new WebChromeClient());
        this.webView.setWebViewClient(new WebViewClient() { // from class: com.gisocn.onemap.ui.activity.WebActivity.1
            @Override // android.webkit.WebViewClient
            public boolean shouldOverrideUrlLoading(WebView webView, String str) {
                webView.loadUrl(str);
                return true;
            }

            @Override // android.webkit.WebViewClient
            public void onPageFinished(WebView webView, String str) {
                super.onPageFinished(webView, str);
                L.e("onPageFinished" + str);
            }
        });
        this.webView.loadUrl(this.actionUrl);
    }
}
